package com.dayatang.hrm.compensation.context;

import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.context.support.ResourceBundleMessageSource;

public class CompensationMessageSource extends ResourceBundleMessageSource {

	private static MessageSourceAccessor messageSourceAccessor;

	public CompensationMessageSource() {
		setBasename("com.dayatang.hrm.compensation.messages");
	}

	public static MessageSourceAccessor getAccessor() {
		if (messageSourceAccessor == null) {
			messageSourceAccessor = new MessageSourceAccessor(
					new CompensationMessageSource());
		}
		return messageSourceAccessor;
	}

	public static void main(String[] args) {
		MessageSourceAccessor accessor = getAccessor();
		System.out.println(accessor.getMessage("give.me.msg"));

	}
}
